@extends('admin.layouts.base')

@section('title','控制面板')

@section('pageHeader','控制面板')

@section('pageDesc','DashBoard')

@section('content')

    <div class="row page-title-row" style="margin:5px;">
        <div class="col-md-6">
			<a href="/admin/table" class="btn btn-success btn-md">
                <i class="fa fa-table"></i> 表格统计模式
            </a>
        </div>
        <div class="col-md-6 text-right">
		
        </div>
    </div>
    <div class="main animsition">
        <div class="container-fluid">
            <div class="row">
                <div class="">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">留言统计</h3>
                        </div>
                        <div class="panel-body">

                            @include('admin.partials.errors')
                            @include('admin.partials.success')
                            	<script type="text/javascript" src="/plugins/jQuery/jQuery-1.7.1.min.js"></script>
								<script src="/js/highcharts.js"></script>
								<script src="/js/exporting.js"></script>
								<script type="text/javascript">
									var chart;
									$(document).ready(function() {
										chart = new Highcharts.Chart({
											chart: {
												renderTo: 'container'
											},
											title: {
												text: '用户留言统计'
											},
											subtitle: {
												text: '数量'
											},
											xAxis: {
												type:'time',
												categories: [@foreach($days as $v)'{{$v}}',@endforeach],
												title: {
													text: null
												},
												allowDecimals:false
											},
											yAxis: {
												min: 0,
												title: {
													text: '总数 (条)',
													align: 'high'
												},
												allowDecimals:false
											},
											tooltip: {
												formatter: function() {
													return ''+
														this.series.name +': '+ this.y +' 条';
													
												}
											},
											plotOptions: {
												bar: {
													dataLabels: {
														enabled: true
													}
												}
											},
											legend: {
												/* layout: 'horizontal', */
												align: 'right',
												verticalAlign: 'top',
												x: -80,
												y: 0,
												floating: true,
												borderWidth: 1,
												backgroundColor: '#FFFFFF',
												shadow: true
											},
											credits: {
												enabled: false
											},
											series: [{
												name: '留言',
												data: [@foreach($counts as $v){{$v}},@endforeach]
											}]
										});
									});
								 
								</script>
								<form action="/admin/chart/index" method="post">
									<input type="hidden" name="_token" value="{{ csrf_token() }}">
									<i class="fa fa-sun-o"></i>&nbsp;<input type="text" name="start_time" class="time" value="{{$start_time}}" placeholder="开始时间"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<i class="fa fa-moon-o">&nbsp;</i><input class="time" type="text" name="end_time" value="{{$end_time}}" placeholder="结束时间"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<i class="fa fa-pied-piper-alt">&nbsp;</i><input type="text" name="name" value="{{$name}}" placeholder="姓名"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<i class="fa fa-phone">&nbsp;</i><input type="text" name="phone" value="{{$phone}}" placeholder="手机号码"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<i class="fa fa-wechat">&nbsp;</i><input type="text" name="wx" value="{{$wx}}" placeholder="微信"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											{{--<i class="fa fa-file-text-o">&nbsp;</i><input type="text" name="query" value="{{$query}}" placeholder="内容"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--}}
									<button type="submit" class="btn btn-success"><i class="fa fa-search"></i>搜索</button>
								</form>
								<br/>
								<div id="container" style="min-width: 200px;min-height:200px; width:100%;; margin: 0 auto"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop